package com.guiji.text2video.fastvideo.service.Impl;

import java.util.List;

import com.guiji.text2video.common.core.utils.DateUtils;
import com.guiji.text2video.fastvideo.domain.vo.Text2videoConfig;
import com.guiji.text2video.fastvideo.mapper.Text2videoConfigMapper;
import com.guiji.text2video.fastvideo.service.IText2videoConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 视频合成配置Service业务层处理
 *
 * @author scl
 * @date 2021-11-23
 */
@Service
public class Text2videoConfigServiceImpl implements IText2videoConfigService {
    @Autowired(required = false)
    private Text2videoConfigMapper text2videoConfigMapper;

    /**
     * 查询视频合成配置
     *
     * @param id 视频合成配置ID
     * @return 视频合成配置
     */
    @Override
    public Text2videoConfig selectText2videoConfigById(Long id) {
        return text2videoConfigMapper.selectText2videoConfigById(id);
    }

    /**
     * 查询视频合成配置列表
     *
     * @param text2videoConfig 视频合成配置
     * @return 视频合成配置
     */
    @Override
    public List<Text2videoConfig> selectText2videoConfigList(Text2videoConfig text2videoConfig) {
        return text2videoConfigMapper.selectText2videoConfigList(text2videoConfig);
    }

    /**
     * 新增视频合成配置
     *
     * @param text2videoConfig 视频合成配置
     * @return 结果
     */
    @Override
    public int insertText2videoConfig(Text2videoConfig text2videoConfig) {
        text2videoConfig.setCreateTime(DateUtils.getNowDate());
        return text2videoConfigMapper.insertText2videoConfig(text2videoConfig);
    }

    /**
     * 修改视频合成配置
     *
     * @param text2videoConfig 视频合成配置
     * @return 结果
     */
    @Override
    public int updateText2videoConfig(Text2videoConfig text2videoConfig) {
        text2videoConfig.setUpdateTime(DateUtils.getNowDate());
        return text2videoConfigMapper.updateText2videoConfig(text2videoConfig);
    }

    /**
     * 批量删除视频合成配置
     *
     * @param ids 需要删除的视频合成配置ID
     * @return 结果
     */
    @Override
    public int deleteText2videoConfigByIds(Long[] ids) {
        return text2videoConfigMapper.deleteText2videoConfigByIds(ids);
    }

    /**
     * 删除视频合成配置信息
     *
     * @param id 视频合成配置ID
     * @return 结果
     */
    @Override
    public int deleteText2videoConfigById(Long id) {
        return text2videoConfigMapper.deleteText2videoConfigById(id);
    }
}